package processor;

/**
 * Created by zhangcheng on 2017/5/2 0002.
 */

import org.apache.http.HttpHost;
import us.codecraft.webmagic.Page;
import us.codecraft.webmagic.Site;
import us.codecraft.webmagic.Spider;
import us.codecraft.webmagic.processor.PageProcessor;
public class News163 implements PageProcessor {
    private Site site = Site.me()
            .setRetryTimes(3)
            .setHttpProxy(new HttpHost("10.101.1.6",80))
            .setSleepTime(1000);
    public void process(Page page) {
        System.out.println(page.getHtml());
    }

    public Site getSite() {
        return this.site;
    }

    public static void main(String[] args) {
        Spider.create(new News163()).addUrl("http://news.163.com/air/17/0502/09/CJDVEBRT000181O6.html").run();
    }
}
